<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="org.DAL.Commande" %>
<%@ page import="org.DAL.Panier" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link media="Screen" href="style.css" type="text/css" rel="stylesheet" />
<title>Mon panier</title>
<script type="text/javascript" src="./script/menu.js">
</script>

</head>
<body onload="loadJSON(false);">
<div class="header">
<a href="catalogue.jsp"><img src="./images/logo.png" alt="Espace Membre" /></a>
	    </div>
<h1>Mon Panier</h1>

<div class="content" id="menu">
		</div>
		<div class="content">
		<a href="catalogue.jsp">Catalogue</a>
<hr>

<%
float total = 0.0f;
if (Panier.getPanier() == null)
{
	out.println("Panier vide !");
	return;
}
for (Commande c : Panier.getPanier())
{
	%>
	<form action="/web_project/SupprDuPanier" method="POST">
	<%
	total += c.getPrixTotal();
	out.println(c.toString());
	%>
	<input type="hidden" value=<%= c.getId() %> name="id"></input>
	<input type="hidden" value=<%= c.getPrix() %> name="prix"></input>
	<input type='text' name='nombre' value='1' size='1' maxlength='3'></input>
	<input type='submit' value='Supprimer du panier'></input>
	<br>
	</form>
	<%
}
out.println ("<br><hr><p>Total = " + total + "</p>");
%>
<input type="submit" value="Passer la commande"></input>
</div>
<div class="foot"><a href="catalogue.jsp">Retour &agrave; l'accueil</a> - <a href="http://jlguillaume.free.fr/">Site de l'UE</a> - 
		<a href="mailto:guillaume.laloum@etu.upmc.fr"> Contact</a> </div>

</body>
</html>